@inject IOptionsSnapshot<BlogSettings> settings
@inject WebManifest manifest
@{
    var host = $"{Context.Request.Scheme}://{Context.Request.Host}";
}
<!DOCTYPE html>
<html lang="en">
<head prefix="og:http://ogp.me/ns#">
    <meta charset="utf-8" />
    <title>@ViewData[Constants.Title]</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="@ViewData[Constants.Description]" />

    <link rel="preload" href="~/js/site.js" as="script" />
    <link rel="preload" href="~/css/belowthefold.scss" as="style" />
    <noscript><link rel="stylesheet" href="~/css/belowthefold.scss" /></noscript>

    @RenderSection(Constants.Preload, required: false)

    <link rel="stylesheet" href="~/css/abovethefold.scss" inline />
    
    <meta property="og:type" content="article" />
    <meta property="og:title" content="@ViewData[Constants.Title]" />
    <meta property="og:description" content="@ViewData[Constants.Description]" />
    <meta property="og:url" content="@(host + Context.Request.Path)" />
    <meta property="og:image" content="@host/img/icon512x512.png" />
    <meta property="og:image:width" content="512" />
    <meta property="og:image:height" content="512" />

    <meta name="msapplication-square150x150logo" content="~/img/icon180x180.png" />

    <link rel="icon" type="image/png" sizes="16x16" href="~/img/icon16x16.png" />
    <link rel="apple-touch-icon" href="~/img/icon180x180.png" />
    <link rel="shortcut icon" href="~/img/icon16x16.png" />

    <link rel="edituri" type="application/rsd+xml" title="RSD" href="~/rsd.xml" />
    <link rel="alternate" type="application/rss+xml" href="~/feed/rss/" />
    <link rel="alternate" type="application/atom+xml" href="~/feed/atom/" />
    @RenderSection(Constants.Head, required: false)

    <meta name="application-name" content="@ViewData[Constants.Title]" />
    <meta name="msapplication-TileColor" content="#ffffff" />
</head>
<body itemscope itemtype="http://schema.org/WebPage">

    <header class="siteheader">
        <div class="container">
            <p itemprop="name"><a href="~/" itemprop="url">@manifest.Name</a></p>
            By <span itemprop="author">@settings.Value.Owner</span>
        </div>
    </header>

    <main itemprop="mainEntity" itemscope itemtype="http://schema.org/Blog" role="main">
        <noscript>
            <p class="container">@Miniblog.Core.Properties.Resources.SomeFeaturesOfThisWebsiteDoNotWorkAsExpectedWhenJavaScriptIsDisabled</p>
        </noscript>
        @RenderBody()
    </main>

    <footer class="sitefooter">
        <div class="container">
            <nav>
                <ul>
                    @{
                        string path = Context.Request.Path;

                        if (User.Identity!.IsAuthenticated)
                        {
                            <li><a asp-controller="Blog" asp-action="Edit" asp-route-id="">@Miniblog.Core.Properties.Resources.NewPost</a></li>
                            <li><a href="~/logout/" title="@Miniblog.Core.Properties.Resources.SignOutAsAdministrator">@Miniblog.Core.Properties.Resources.SignOut</a></li>
                        }
                        else
                        {
                            <li><a href="~/login/?returnUrl=@path" rel="nofollow" title="@Miniblog.Core.Properties.Resources.SignInAsAdministrator">@Miniblog.Core.Properties.Resources.SignIn</a></li>
                        }
                    }
                </ul>
            </nav>
            <p>
                @Miniblog.Core.Properties.Resources.PoweredBy <a href="https://github.com/madskristensen/Miniblog.Core" rel="noopener noreferrer" target="_blank">@Miniblog.Core.Properties.Resources.MiniblogCore</a>
            </p>
        </div>
    </footer>

    @* This lazy loads the stylesheet in a non-render blocking way *@
    <link rel="preload" href="~/css/belowthefold.scss" as="style" />
    <noscript><link rel="stylesheet" href="~/css/belowthefold.scss" /></noscript>

    <script src="~/js/site.js" async defer></script>
    @RenderSection(Constants.Scripts, required: false)
</body>
</html>
